<template>
  <div class="app-container">
    <div class="head">
      <img src="@/assets/img/Layout/position.png" />
      <p class="see-block">公司配置详情</p>
    </div>
    <div class="view-container">
      <el-row class="detail-item">
        <el-col :span="24">
            <span>公司logo：</span>
            <div style="width:100%;">
              <img v-if="detailData.logo" :src="detailData.logo" class="avatar">
              <p v-else>暂无</p>
            </div>
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="10">
            <span>公司名称：</span>{{ detailData.name ?  detailData.name : '暂无'}}
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="10">
            <span>生产商：</span>{{ detailData.manufacturer ?  detailData.manufacturer : '暂无'}}
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="10">
            <span>委托方：</span>{{ detailData.client ?  detailData.client : '暂无'}}
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="10">
            <span>模板配置：</span>{{ detailData.electronicAntiTemplateId ?  detailData.electronicAntiTemplateId : '暂无'}}
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="10">
            <span>公众号二维码地址：</span>{{ detailData.officialAccount ?  detailData.officialAccount : '暂无'}}
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="10">
            <span>跳转地址：</span>{{ detailData.attachJumpLink ?  detailData.attachJumpLink : '暂无'}}
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="10">
            <span>扫码次数限制：</span>{{ detailData.scanCodeTimes ?  detailData.scanCodeTimes : '暂无'}}
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { antiCodeCompanyConfigDetail, antiCodeTemplateList } from "@/api/system/antiCode/antiCode"
export default {
  name: "detail",
  data(){
    return {
      id: '',
      detailData: '',
    }
  },
  created() {
    this.id = this.$route.query.id
    this.getDetailData()
  },
  methods: {
    // 获取详情信息
    getDetailData() {
      antiCodeCompanyConfigDetail(this.id).then(res => {
        this.detailData = res.data
        this.getAntiCodeTemplateList()
      })
    },
    // 获取销售区域
    getAntiCodeTemplateList(){
      antiCodeTemplateList().then(res => {
        let arr = res.rows.find(item =>{
          return item.id == this.detailData.electronicAntiTemplateId
        })
        if(arr != undefined){
          this.detailData.electronicAntiTemplateId = arr.templateName
        }
      })
    },
  }
}
</script>


<style scoped>
.avatar {
  width: 150px;
  display: block;
}
</style>